package com.cainaer.orders.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cainaer.orders.domain.OrderReturnsApply;
import com.cainaer.orders.mapper.OrderReturnsApplyMapper;

import com.cainaer.orders.service.IOrderReturnsApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 售后申请表 服务实现类
 * </p>
 *
 * @author Tina
 * @since 2020-09-11
 */
@Service
public class OrderReturnsApplyServiceImpl extends ServiceImpl<OrderReturnsApplyMapper, OrderReturnsApply> implements IOrderReturnsApplyService {

    @Autowired
    private OrderReturnsApplyMapper orderReturnsApplyMapper;

    /**
     * 新增 售后申请
     *
     * @param orderReturnsApply
     * @return
     */
    @Override
    public Integer insertOrderReturnsApply(OrderReturnsApply orderReturnsApply) {
        return orderReturnsApplyMapper.insert(orderReturnsApply);
    }

    /**
     * 编辑 售后申请
     *
     * @param orderReturnsApply
     * @return
     */
    @Override
    public Integer editOrderReturnsApply(OrderReturnsApply orderReturnsApply) {
        return orderReturnsApplyMapper.updateById(orderReturnsApply);
    }

    /**
     * 查询 售后申请
     *
     * @param orderReturnsApply
     * @return
     */
    @Override
    public List<OrderReturnsApply> selectOrderReturnsApply(OrderReturnsApply orderReturnsApply) {
        QueryWrapper queryWrapper = new QueryWrapper();
        return orderReturnsApplyMapper.selectList(queryWrapper);
    }
}
